#!/bin/bash

echo "docker Chat-GPT 4.0 make"

# 拉取镜像
docker pull python:3.10

# 查看内存
free -h

if [ ! -e /opt/GPTChat/XRchatgpt ]; then mkdir -p /opt/GPTChat/XRchatgpt; fi
docker run -itd \
    --env DASHSCOPE_API_KEY=sk-178f7fc245424c92b4b93ebc4eac1df8 \
    --name GPTChat \
    --network allinpay \
    --shm-size="4G" \
    --restart=always \
    --workdir=/opt/XRchatgpt \
    -v /opt/GPTChat:/opt \
    -p 8000:8000 \
    python:3.10 bash /opt/XRchatgpt/run-bash.sh

firewall-cmd --add-port=8000/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all    

# 容器内导出python环境
# pip3 list --format=freeze > requirements.txt


docker run -itd \
    --name GPTChat \
    --network allinpay \
    --shm-size="4G" \
    --workdir=/opt/XRchatgpt \
    --restart=always \
    -v /opt/GPTChat:/opt \
    -p 8000:8000 \
    python:3.10 bash /opt/XRchatgpt/run-bash.sh


docker update --restart=always GPTChat